.TH LIBPFM 3  "Apr, 2006" "" "Linux Programmer's Manual"
.SH NAME
pfm_regmask_set, pfm_regmask_isset, pfm_regmask_clr, pfm_regmask_weight,
pfm_regmask_eq, pfm_regmask_and, pfm_regmask_or, pfm_regmask_copy
-\ operations on pfmlib_regmask_t bitmasks
.SH SYNOPSIS
.nf
.B #include <perfmon/pfmlib.h>
.sp
.BI "int pfm_regmask_isset(pfmlib_regmask_t *"mask ",  unsigned int "b ");"
.BI "int pfm_regmask_set(pfmlib_regmask_t *"mask ",  unsigned int "b ");"
.BI "int pfm_regmask_clr(pfmlib_regmask_t *"mask ",  unsigned int "b ");"
.BI "int pfm_regmask_weight(pfmlib_regmask_t *"mask ", unsigned int *"w ");"
.BI "int pfm_regmask_eq(pfmlib_regmask_t *"mask1 ", pfmlib_regmask_t *"mask2 ");"
.BI "int pfm_regmask_and(pfmlib_regmask_t *"dest ", pfmlib_regmask_t *"m1 ", pmlib_regmask_t *"m2 ");"
.BI "int pfm_regmask_or(pfmlib_regmask_t *"dest ", pfmlib_regmask_t *"m1 ", pmlib_regmask_t *"m2 ");"
.BI "int pfm_regmask_copy(pfmlib_regmask_t *"dest ", pfmlib_regmask_t *"src ");"
.sp
.SH DESCRIPTION
This set of function is used to operate of the \fBpfmlib_regmask_t\fR bitmasks
that are returned by certain functions or passed to the \fBpfm_dispatch_events()\fR function.

To ensure portability, it is important that applications use \fBonly\fR the 
functions specified here to access the bitmasks. It is strongly discouraged
to access the internal fields of the \fBpfm_regmask_t\fR structure.

The \fBpfm_regmask_set()\fR function is used to set bit \fBb\fR in the bitmask
\fBmask\fR.

The \fBpfm_regmask_clr()\fR function is used to clear bit \fBb\fR in the bitmask
\fBmask\fR.

The \fBpfm_regmask_isset()\fR function returns a non-zero value if \fBb\fR is set
in the bitmask \fBmask\fR.

The \fBpfm_regmask_weight()\fR function returns in \fBw\fR the number of bits set
in the bitmask \fBmask\fR.

The \fBpfm_regmask_eq()\fR function returns a non-zero value if the bitmasks
\fBmask1\fR and \fBmask2\fR are identical.

The \fBpfm_regmask_and()\fR function returns in bitmask \fBdest\fR the result of
the logical AND operation between bitmask \fBm1\fR and bitmask \fBm2\fR.

The \fBpfm_regmask_or()\fR function returns in bitmask \fBdest\fR the result of
the logical OR operation between bitmask \fBm1\fR and bitmask \fBm2\fR.

The \fBpfm_regmask_copy()\fR function copies bitmask \fBsrc\fR into bitmask
\fRdest\fR.

.SH RETURN
The function returns whether or not it was successful.
A return value of \fBPFMLIB_SUCCESS\fR indicates success, 
otherwise the value is the error code.
.SH ERRORS
.B PFMLIB_ERR_INVAL
the bit \fBb\fR exceeds the limit supported by the library
.SH AUTHOR
Stephane Eranian <eranian@hpl.hp.com>
.PP
